package com.projecy.common.utils;

import java.io.PrintWriter;
import java.io.StringWriter;


public class ThrowsUtil {


    public static String getStackTrace(Throwable throwable){//获取错误的堆栈信息
        System.out.println("获取错误的堆栈信息");
        StringWriter sw = new StringWriter();
        try (PrintWriter pw = new PrintWriter(sw)) {
            throwable.printStackTrace(pw);
            return sw.toString();
        }
    }
}
